package cn.iocoder.yudao.module.mybusiness.controller.admin;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.mybusiness.domain.Facility;
import cn.iocoder.yudao.module.mybusiness.service.AnalyzeService;
import cn.iocoder.yudao.module.mybusiness.util.InitCraft;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@RequestMapping("/analyze")
@RestController
public class AnalyzeController {

    @Autowired
    private AnalyzeService analyzeService;

    @Autowired
    private InitCraft initCraft;

    @GetMapping("/getIndexBlock")
    public CommonResult<Map> getIndexBlock(){
        Map indexBlock = analyzeService.getIndexBlock();
        return success(indexBlock);
    }

    @GetMapping("/getCraftStandard")
    public CommonResult<Map> getCraftStandard(){
        Map map = new HashMap();
        map.put("crafts",initCraft.getCraftList());
        map.put("standards",initCraft.getStandardChanceList());
        return success(map);
    }
}
